package com.fagejiang.memory;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import java.util.concurrent.Executor;

/**
 * 你还没有写描述儿~
 *
 * @author 发哥讲Java
 * @version 1.0
 * @date 2021-06-02 16:59
 */
@Component
@Slf4j
public class CustomApplicationRunner implements ApplicationRunner {
    @Autowired
    Executor customExecutor;
    @Autowired
    BizService bizService;

    @Override
    public void run(ApplicationArguments args) throws Exception {

        bizService.initData();
        log.info("{} 获取{}的值为:{} ", this.getClass().getName(), 1, DataPool.getCunJWHNameByDm("key" + 1));
        customExecutor.execute(() -> bizService.executeTask1());
    }
}
